package com.numberone.web.controller.assess;

import com.numberone.framework.web.base.BaseController;
import com.numberone.system.domain.Assess;
import com.numberone.system.service.IAssessService;
import com.numberone.system.util.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/api/assess")
public class AssessApiController extends BaseController {
    @Autowired
    private IAssessService assessService;

    /**
     * 评论商品
     * @param assess
     * @return
     */
    @ResponseBody
    @PostMapping("/addAssess")
    public Object addAssess(Assess assess)
    {
        int i = assessService.insertAssess(assess);
        if (i > 0)
        {
            return JsonResult.success();
        }
        return JsonResult.defaultError();
    }
}
